package com.example.androidcomplete0102.ch12;

import java.util.ArrayList;

import com.example.androidcomplete0102.R;
import com.example.androidcomplete0102.ch12.CustomAdapterView.MyItem;
import com.example.androidcomplete0102.ch12.CustomAdapterView.MyListAdapter;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class CustomAdapterView02 extends Activity {
	
	ArrayList<MyMenu> arLists;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch12_listviewarraylist);
		
		arLists = new ArrayList<>();
		arLists.add(new MyMenu(R.drawable.ic_launcher, "삼성노트북"));
		arLists.add(new MyMenu(R.drawable.btnexit_normal, "lg세탁기"));
		arLists.add(new MyMenu(R.drawable.toycar, "대우 마티즈"));
		
		MyCustomAdapter adapter = new MyCustomAdapter(this, R.layout.ch12_icontext, arLists);
		
		ListView listView = (ListView)findViewById(R.id.ch12_listView);
		listView.setAdapter(adapter);
		
	}
}
